import React, { Component } from 'react';
import { glabalContext } from './common/js/globalData';
const {Consumer} = glabalContext
class TransferToChild2 extends Component {
  state = {  }
  render() { 
    return ( <div>
      子组件child2：(我和child1是兄弟)
      {/* 也读取父组件的我role数据 */}
      <Consumer>
        {
          value=>(<div>{value.role}</div>)
        }
      </Consumer>
    </div> );
  }
}
 
export default TransferToChild2;